import { Menu } from 'antd';
import { useNavigate } from "react-router-dom"

const items = [
    { label: '首页', key: "/home" },
    { label: '文章管理', key: "/postManage" },
]
const App = () => {
    const navigate = useNavigate()
    const onClick = (e) => {
        console.log('click ', e);
        navigate(e.key)
    };
    return (
        <Menu
            onClick={onClick}
            style={{
                width: 256,
            }}
            defaultSelectedKeys={['home']}
            defaultOpenKeys={['sub1']}
            mode="inline"
            items={items}
        />
    );
};
export default App;